<?php
declare (strict_types=1);

namespace app\model;

use think\Model;

/**
 * @mixin Model
 */
class Materials extends Model
{
    public function category()
    {
        return $this->hasOne(Category::class, 'id', 'category_id');
    }

    public function warehouse()
    {
        return $this->hasOne(Warehouse::class, 'id', 'warehouse_id');
    }

    public function coverInfo()
    {
        return $this->hasOne(Attach::class, 'key', 'cover');
    }
}
